import unittest
import dao

class MyTestCase(unittest.TestCase):
    def test_select_row(self):
        daoImpl = dao.DAOImpl("./test.db")
        row = daoImpl.select_row_by_range("tourist_spot", "status", "id", 100, 200)
        print(row)

    def test_select_row_finished(self):
        daoImpl = dao.DAOImpl("./test.db")
        row = daoImpl.select_row_finished("tourist_spot", "status", "id", 50, 200)
        print(row)

    def test_update_a_row(self):
        daoImpl = dao.DAOImpl("./test.db")
        row = daoImpl.update_a_row("tourist_spot", "id", 43, "aspect", 2)
        row = daoImpl.update_a_row("tourist_spot", "id", 43, "status", 1)
        print("更新完毕")


if __name__ == '__main__':
    unittest.main()
